#ifndef DATACONTAINER_H
#define DATACONTAINER_H

#include <QObject>
#include <QDebug>
#include <QString>
#include <QList>
#include <QHash>

#include "contigdatapacket.h"
#include "genomeelementdatapacket.h"

class DataContainer : public QObject
{
    Q_OBJECT
public:
    explicit DataContainer(QObject *parent = 0);

    void addContigDataPacket( ContigDataPacket* cdp );
    void addGenomeElementDataPacket( GenomeElementDataPacket* gdps);

    void appendGenomeElements( QList< QPointer<GenomeElementDataPacket> > gdps );
    void appendContigs( QList< QPointer<ContigDataPacket> > cdps );

    ContigDataPacket* getContigDataPacket(int idx);
    ContigDataPacket* getContigDataPacket(QString key);
    GenomeElementDataPacket* getGenomeElementDataPacket(int idx);
    GenomeElementDataPacket* getGenomeElementDataPacket(QString key);

    int getNumGenomeElements();
    int getNumContigs();

    bool containsContigDataPacket( QString key );
    bool containsGenomeElementDataPacket( QString key);

    void removeContigDataPacket( QString key );
    void removeGenomeElementDataPacket( QString key );
    
    void clear();
    void clearAndDelete();

signals:
    
public slots:

protected:
    QList<ContigDataPacket*> contigDataPackets;
    QList<GenomeElementDataPacket*> genomeElementDataPackets;

    QHash<QString, int> hashedContigs;
    QHash<QString, int> hashedGenomeElements;
    
};

#endif // DATACONTAINER_H
